﻿#include "FITKLoadExcitationForceMoments.h"
#include "FITKAcousticsAbstractSpectra.h"
#include "FITK_Kernel/FITKCore/FITKDataRepo.h"

namespace Acoustics
{
    FITKLoadExcitationForceMoments::FITKLoadExcitationForceMoments()
    {
        //构造
    }

    FITKLoadExcitationForceMoments::~FITKLoadExcitationForceMoments()
    {
        //析构
    }

    FITKAcousticsAbstractLoad::AcousticsLoadType FITKLoadExcitationForceMoments::getAcousticsLoadType()
    {
        //获取载荷类型
        return FITKAcousticsAbstractLoad::AcousticsLoadType::ExcitationForceMoments;
    }

    bool FITKLoadExcitationForceMoments::copy(FITKAbstractDataObject* obj)
    {
        //拷贝数据
        FITKLoadExcitationForceMoments* oldObj = dynamic_cast<FITKLoadExcitationForceMoments*>(obj);
        if (!oldObj) return false;
        _enabledState = oldObj->_enabledState;
        _notes = oldObj->_notes;
        _connectObjID = oldObj->_connectObjID;
        _forceSpectraID = oldObj->_forceSpectraID;
        _forceOrientationVec[0] = oldObj->_forceOrientationVec[0];
        _forceOrientationVec[1] = oldObj->_forceOrientationVec[1];
        _forceOrientationVec[2] = oldObj->_forceOrientationVec[2];
        _momentSpectraID = oldObj->_momentSpectraID;
        _momentOrientationVec[0] = oldObj->_momentOrientationVec[0];
        _momentOrientationVec[1] = oldObj->_momentOrientationVec[1];
        _momentOrientationVec[2] = oldObj->_momentOrientationVec[2];
        _offsetValue[0] = oldObj->_offsetValue[0];
        _offsetValue[1] = oldObj->_offsetValue[1];
        _offsetValue[2] = oldObj->_offsetValue[2];
        this->Core::FITKAbstractNDataObject::copy(obj);
        return true;
    }

    void FITKLoadExcitationForceMoments::setIndirectRadiation(bool state)
    {
        //设置间接辐射启用状态
        _indirectRadiation = state;
    }

    bool FITKLoadExcitationForceMoments::getIndirectRadiation()
    {
        //获取间接辐射启用状态
        return _indirectRadiation;
    }

    void FITKLoadExcitationForceMoments::setForceSpectraID(int spectraID)
    {
        //设置力谱ID
        _forceSpectraID = spectraID;
    }

    int FITKLoadExcitationForceMoments::getForceSpectraID()
    {
        //获取力谱ID
        return _forceSpectraID;
    }

    FITKAcousticsAbstractSpectra* FITKLoadExcitationForceMoments::getForceSpectraObj()
    {
        //获取力谱数据对象
        return FITKDATAREPO->getTDataByID<FITKAcousticsAbstractSpectra>(_forceSpectraID);
    }

    void FITKLoadExcitationForceMoments::setForceOrientationVec(double* forceOrien)
    {
        //设置力方向
        _forceOrientationVec[0] = forceOrien[0];
        _forceOrientationVec[1] = forceOrien[1];
        _forceOrientationVec[2] = forceOrien[2];
    }

    void FITKLoadExcitationForceMoments::getForceOrientationVec(double* forceOrien)
    {
        //获取力方向
        forceOrien[0] = _forceOrientationVec[0];
        forceOrien[1] = _forceOrientationVec[1];
        forceOrien[2] = _forceOrientationVec[2];
    }

    void FITKLoadExcitationForceMoments::setMomentSpectraID(int spectraID)
    {
        //设置力矩谱ID
        _momentSpectraID = spectraID;
    }

    int FITKLoadExcitationForceMoments::getMomentSpectraID()
    {
        //获取力矩谱ID
        return _momentSpectraID;
    }

    FITKAcousticsAbstractSpectra* FITKLoadExcitationForceMoments::getMomentSpectraObj()
    {
        //获取力矩谱数据对象
        return FITKDATAREPO->getTDataByID<FITKAcousticsAbstractSpectra>(_momentSpectraID);
    }

    void FITKLoadExcitationForceMoments::setMomentOrientationVec(double* momentOrien)
    {
        //设置力矩方向
        _momentOrientationVec[0] = momentOrien[0];
        _momentOrientationVec[1] = momentOrien[1];
        _momentOrientationVec[2] = momentOrien[2];
    }

    void FITKLoadExcitationForceMoments::getMomentOrientationVec(double* momentOrien)
    {
        //获取力矩方向
        momentOrien[0] = _momentOrientationVec[0];
        momentOrien[1] = _momentOrientationVec[1];
        momentOrien[2] = _momentOrientationVec[2];
    }

    void FITKLoadExcitationForceMoments::setOffsetValue(double* offset)
    {
        //设置偏移量
        _offsetValue[0] = offset[0];
        _offsetValue[1] = offset[1];
        _offsetValue[2] = offset[2];
    }

    void FITKLoadExcitationForceMoments::getOffsetValue(double* offset)
    {
        //获取偏移量
        offset[0] = _offsetValue[0];
        offset[1] = _offsetValue[1];
        offset[2] = _offsetValue[2];
    }

    void FITKLoadExcitationForceMoments::setFENodeID(int nodeID)
    {
        _nodeIDFE = nodeID;
    }

    int FITKLoadExcitationForceMoments::getFENodeID()
    {
        return _nodeIDFE;
    }
}